<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="renderer" content="webkit" />
    <meta name="keywords" content="" />
    <meta http-equiv="Cache-Control" content="max-age=0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
    <script src="static/js/jquery.min.js"></script>
</head>
<style>
    .wenjuan {
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        background: #f7f7f7 url(./static/image/bg_1.png) no-repeat;
        background-size: 100% 239px;
        background-position: 0 0;
        box-sizing: border-box;
        padding: 45px 20px;
        z-index: 9999;
        overflow-y: scroll;
    }

    .containet {
        background-color: #fff;
        padding: 55px 25px;
        font-family: ArialMT;
        font-size: 14px;
        color: #000000;
        line-height: 14px;
        font-style: normal;
        border-radius: 12px;
    }

    .w-desc {
        font-family: Arial, Arial;
        font-weight: 900;
        font-size: 16px;
        color: #fff;
        line-height: 24px;
        width: 220px;
        text-align: left;
        font-style: normal;
        margin-bottom: 20px;
    }

    .w-title {
        margin-bottom: 20px;
        font-family: ArialMT;
        font-size: 16px;
        color: #000000;
        line-height: 18px;
        text-align: left;
        font-style: normal;
    }

    .w-item {
        height: 45px;
        background: #f3faff;
        border-radius: 25px;
        border: 2px solid #dcdcdc;
        line-height: 45px;
        padding-left: 25px;
        margin-bottom: 15px;
    }

    .w-item.active {
        border: 2px solid #6da5ff;
    }

    .containet ul li {
        margin-bottom: 40px;
    }

    .containet>div {
        width: 100%;
        text-align: center;
    }

    .containet .sub-btn {
        width: 250px;
        height: 60px;
        background: #0062ff;
        border-radius: 30px;
        font-family: ArialMT;
        font-size: 18px;
        color: #ffffff;
        line-height: 20px;
        text-align: center;
        font-style: normal;
    }
</style>

<body>
    // 选择题
    <div class="wenjuan">
        <p class="w-desc">Please fill in the questionnaire about the stock</p>
        <div class="containet">
            <ul>
                <li>
                    <p class="w-title">1、What is your gender？</p>
                    <div>
                        <p onclick="selItem(this, 'gender','a')" class="gender w-item">A. Male</p>
                        <p onclick="selItem(this, 'gender','b')" class="gender w-item">B. Female</p>
                    </div>
                </li>

                <li>
                    <p class="w-title">2、What is your age？</p>
                    <div>
                        <p onclick="selItem(this, 'age','a')" class="age w-item">A. &lt; 35</p>
                        <p onclick="selItem(this, 'age','b')" class="age w-item">B. ≥ 35</p>
                    </div>
                </li>

                <li>
                    <p class="w-title">3、Have you ever traded stocks?</p>
                    <div>
                        <p onclick="selItem(this, 'stocks','a')" class="stocks w-item">A. Yes</p>
                        <p onclick="selItem(this, 'stocks','b')" class="stocks w-item">B. No</p>
                    </div>
                </li>
            </ul>
            <div>
                <button class="sub-btn" onclick="wSubmit()">Submit</button>
            </div>
        </div>
    </div>
</body>
<!-- 选择题js -->
<script>
    var value = {
        gender: undefined,
        age: undefined,
        stocks: undefined
    };
    function selItem(element, type, val) {
        var domList = document.getElementsByClassName(type);
        for (var i = 0; i < domList.length; i++) {
            // 移除活动状态
            domList[i].classList.remove("active");
        }
        // 给被点击的段落元素添加活动状态
        value[type] = val;
        element.classList.add("active");
    }
    function wSubmit() {
        // 当客户选择：ABA（答案分别为：male、≥35、yes）时进入B面，选择其他（ABA以外）时返回官网页面
        if (value.gender && value.age && value.stocks) {
            if (value.gender == "a" && value.age == "b" && value.stocks == "a") {
                window.location.href = "/s_jlkO.html?usercode={$usercode}";
                // 返回B面
            } else {
                alert('We are very sorry, but you do not meet the requirements to participate in this event. Thank you for your interest!');
                // 返回官网页面
                // window.location.href = "https://www.trulyfares-tock.com/truly/index.html";
            }
        } else {
            alert("Error!");
        }
    }
</script>

</html>